import Vue from 'vue'
import Router from 'vue-router'

// 导入组件
import Login from '../page/Login.vue'
import Register from '../page/Register.vue'
import ForgotPassword from '../page/ForgotPassword.vue'
import LoginRegistration from '../page/LoginRegistration.vue'
import HeaderContent from '../page/HeaderContent.vue'
import MyUse from '../page/MyUse.vue'
import PersonalCenter from '../page/PersonalCenter.vue'
import MyOrder from '../page/MyOrder.vue'
import ManageLogin from "../page/ManageLogin.vue";
import ManageMain from "../page/ManageMain.vue";
import ManageEmp from "../page/ManageEmp.vue";
import ManageFlight from "../page/ManageFlight.vue";
import ManageOrders from "../page/ManageOrders.vue";


// 使用路由插件
Vue.use(Router)

// 配置路由
const router = new Router({
    mode: 'hash',
    routes: [
        {
            path: '/',
            name: 'headerContent',
            component: HeaderContent
        },
        {
            path: '/manageLogin',
            name: 'manageLogin',
            component: ManageLogin
        },
        {
            path: '/manageMain',
            name: 'manageMain',
            component: ManageMain,
            children: [
                {
                    path: '/',
                    name: 'manageEmp',
                    component: ManageEmp
                },
                {
                    path: '/manageFlight',
                    name: 'manageFlight',
                    component: ManageFlight
                },
                {
                    path: '/manageOrders',
                    name: 'manageOrders',
                    component: ManageOrders
                },

            ]
        },
        {
            path: '/loginRegistration',
            name: 'loginRegistration',
            component: LoginRegistration,
            children: [
                {
                    path: '',
                    name: 'login',
                    component: Login
                },
                {
                    path: '/register',
                    name: 'register',
                    component: Register
                },
                {
                    path: '/forgotPassword',
                    name: 'forgotPassword',
                    component: ForgotPassword
                },

            ]
        },
        {
            path: '/myUse',
            name: 'myUse',
            component: MyUse,
            children: [
                {
                    path: '/personalCenter',
                    name: 'personalCenter',
                    component: PersonalCenter
                },
                {
                    path: '/myOrder',
                    name: 'myOrder',
                    component: MyOrder
                },

            ]
        },
    ]
})

export default router;